import { defineStore } from "pinia"
import { ElMessage } from "element-plus";
export const cnyzsCommonpinia = defineStore("cnyzsCommonpinia", {
   state: () => ({
      cnyzs: {} as any,
      openLogin: false, // 控制PC端登录框开关
      openMoney: false, // 控制PC端充值框开关
      managementShow: false, // 控制PC端系统管理框开关
      systemType: '',
   }),
   getters: {},
   actions: {
      // 获取配置文件
      getConfig: async function () {
         const config: any = await cnyzsRequest('/api/config/query', { method: 'GET' });
         this.cnyzs = config.data
         this.systemType = config.data.COMMON_PC_HOME_TEMPLATE || "empty" // 将某个系统设置到首页展示时启用
      },

   },
})